<html>
<head><meta charset="utf-8"><title>builtin traits · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html">builtin traits</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="191134647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191134647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191134647">(Mar 19 2020 at 16:02)</a>:</h4>
<p>figured I'd make a stream for this</p>



<a name="191135710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191135710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191135710">(Mar 19 2020 at 16:08)</a>:</h4>
<p>So, what's going to be somewhat useful here is how rustc used to handle builtin traits for the old chalk integration: <a href="https://github.com/rust-lang/rust/blob/21affdd00d52fba6388f1858a52c253b3f83a90d/src/librustc_traits/chalk_context/program_clauses/builtin.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/21affdd00d52fba6388f1858a52c253b3f83a90d/src/librustc_traits/chalk_context/program_clauses/builtin.rs">https://github.com/rust-lang/rust/blob/21affdd00d52fba6388f1858a52c253b3f83a90d/src/librustc_traits/chalk_context/program_clauses/builtin.rs</a></p>



<a name="191136030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136030">(Mar 19 2020 at 16:11)</a>:</h4>
<p>I do say somewhat because I feel like our implementation will end up looking quite different</p>



<a name="191136119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136119">(Mar 19 2020 at 16:12)</a>:</h4>
<p>okay</p>



<a name="191136124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136124">(Mar 19 2020 at 16:12)</a>:</h4>
<p>ill read that a bit</p>



<a name="191136198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136198">(Mar 19 2020 at 16:13)</a>:</h4>
<p>right off the bat see fun syntax</p>



<a name="191136219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136219">(Mar 19 2020 at 16:13)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">        </span><span class="n">goal</span>: <span class="nc">ty</span>::<span class="n">TraitPredicate</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">trait_ref</span>: <span class="nc">ty</span>::<span class="n">TraitRef</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">def_id</span>: <span class="nc">trait_def_id</span><span class="p">,</span><span class="w"> </span><span class="n">substs</span>: <span class="nc">tcx</span><span class="p">.</span><span class="n">mk_substs_trait</span><span class="p">(</span><span class="n">ty</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="p">[])</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="191136229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136229">(Mar 19 2020 at 16:13)</a>:</h4>
<p>is this valid in stable / nightly?</p>



<a name="191136243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136243">(Mar 19 2020 at 16:13)</a>:</h4>
<p>or is this the type asscription feature</p>



<a name="191136297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136297">(Mar 19 2020 at 16:13)</a>:</h4>
<p>ooh duh</p>



<a name="191136305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136305">(Mar 19 2020 at 16:13)</a>:</h4>
<p>its in a constructor</p>



<a name="191136307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136307">(Mar 19 2020 at 16:13)</a>:</h4>
<p>IGNORE ME</p>



<a name="191136391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136391">(Mar 19 2020 at 16:14)</a>:</h4>
<p>i blame github syntax hightlighting for being different from my local stuff and brains being dumb with pattern matching</p>



<a name="191136400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136400">(Mar 19 2020 at 16:14)</a>:</h4>
<p><em>whistles innocently</em></p>



<a name="191136559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136559">(Mar 19 2020 at 16:15)</a>:</h4>
<p>why you no have documentation explaining what you mean!? <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TraitPredicate.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TraitPredicate.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TraitPredicate.html</a></p>



<a name="191136929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136929">(Mar 19 2020 at 16:18)</a>:</h4>
<p>so this first one is just representing a fact in chalk</p>



<a name="191136965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136965">(Mar 19 2020 at 16:18)</a>:</h4>
<p>the goals represent the first half of the statement before the <code>:-</code></p>



<a name="191136984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136984">(Mar 19 2020 at 16:19)</a>:</h4>
<p>and then the hypothesis is the rhs</p>



<a name="191136998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191136998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191136998">(Mar 19 2020 at 16:19)</a>:</h4>
<p>and this is basically just saying</p>



<a name="191137026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191137026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191137026">(Mar 19 2020 at 16:19)</a>:</h4>
<p>if all of the nested generic args impl that trait then this type implements the trait</p>



<a name="191137427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191137427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191137427">(Mar 19 2020 at 16:22)</a>:</h4>
<p>right</p>



<a name="191137592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191137592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191137592">(Mar 19 2020 at 16:23)</a>:</h4>
<p>I'm not completely sure how helpful this will <em>actually</em> be</p>



<a name="191137602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191137602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191137602">(Mar 19 2020 at 16:23)</a>:</h4>
<p>but I figured I would paste it</p>



<a name="191138037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191138037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191138037">(Mar 19 2020 at 16:26)</a>:</h4>
<p>The other piece of code that is also going to be somewhat relevant to this (probably) is: <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L46" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L46">https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L46</a></p>



<a name="191531017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191531017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191531017">(Mar 23 2020 at 20:21)</a>:</h4>
<p>So <span class="user-mention" data-user-id="220273">@Jane Lusby</span> it's probably best to start with a specific builtin trait</p>



<a name="191531087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191531087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191531087">(Mar 23 2020 at 20:22)</a>:</h4>
<p>I guess that <code>Sized</code> is the most common one</p>



<a name="191531101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191531101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191531101">(Mar 23 2020 at 20:22)</a>:</h4>
<p>I'm not sure, <span class="user-mention" data-user-id="232957">@Jack Huey</span>, did we land any code for <code>Sized</code>?</p>



<a name="191533052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533052">(Mar 23 2020 at 20:39)</a>:</h4>
<p>In general, the rule for <code>Sized</code> is that the <em>builtin</em> types are sized, but for structs with fields we look at the last field, and the struct is sized iff that last field is Sized (the WF rules forbid fields other than the last field from being potentially unsized).</p>



<a name="191533168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533168">(Mar 23 2020 at 20:40)</a>:</h4>
<p>WF rules?</p>



<a name="191533426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533426">(Mar 23 2020 at 20:42)</a>:</h4>
<p>"well formed" rules, meaning the checks that are required to declare a struct definition as valid</p>



<a name="191533854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533854">(Mar 23 2020 at 20:45)</a>:</h4>
<p>So, <span class="user-mention" data-user-id="220273">@Jane Lusby</span>, I'm not sure how well you understand the overall chalk "pipeline"&lt; but the idea here is that there is a callback that gets invoked that has the job of basically translated Rust declarations into logical predicates.</p>



<a name="191533921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533921">(Mar 23 2020 at 20:46)</a>:</h4>
<p>Specifically, it gets invokved when the solver is saying "I have to check if <code>T: Foo</code> is true ("prove" it), and I need to know all the ways to do that"</p>



<a name="191533977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191533977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191533977">(Mar 23 2020 at 20:46)</a>:</h4>
<p>normally we do that by turning around asking the <code>RustIrDatabase</code> something like "give me all the impls of <code>Foo</code>" and then translating those impls into logical rules</p>



<a name="191534007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191534007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191534007">(Mar 23 2020 at 20:47)</a>:</h4>
<p>but the idea here is that we look at the trait <code>Foo</code> and -- if we see that it is <code>Sized</code> -- we can insert some built-in responses</p>



<a name="191534037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191534037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191534037">(Mar 23 2020 at 20:47)</a>:</h4>
<p>also, really, we can usually do better than "all impls" -- i.e., we might look for impls that could possibly match the type <code>T</code></p>



<a name="191534735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191534735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191534735">(Mar 23 2020 at 20:52)</a>:</h4>
<p>I see</p>



<a name="191534809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191534809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191534809">(Mar 23 2020 at 20:53)</a>:</h4>
<p>I don't know the chalk pipeline much at all, other than the general ideas from a talk sunjay gave on orphan rules + chalk almost 2 years ago</p>



<a name="191534855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191534855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191534855">(Mar 23 2020 at 20:53)</a>:</h4>
<p>so this is all good info</p>



<a name="191535112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191535112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191535112">(Mar 23 2020 at 20:55)</a>:</h4>
<p>Well, for one thing, a lot of this didn't exist  -- at least not in its current form -- when <span class="user-mention silent" data-user-id="117350">Sunjay Varma</span> was working on chalk, but also this stuff needs to get cleaned up and better document</p>



<a name="191537073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191537073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191537073">(Mar 23 2020 at 21:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191531101" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191531101">said</a>:</p>
<blockquote>
<p>I'm not sure, <span class="user-mention silent" data-user-id="232957">Jack Huey</span>, did we land any code for <code>Sized</code>?</p>
</blockquote>
<p>We have not</p>



<a name="191539448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539448">(Mar 23 2020 at 21:30)</a>:</h4>
<p>So <span class="user-mention" data-user-id="220273">@Jane Lusby</span> <code>Sized</code> is probably a good place to start</p>



<a name="191539551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539551">(Mar 23 2020 at 21:31)</a>:</h4>
<p>in case you're trying to read into the code, <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L104-L113" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L104-L113">this is the callback</a> that I was talking about -- it is supposed to return "program clauses" (logical rules) that could be used to prove the given goal in the given environment</p>



<a name="191539659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539659">(Mar 23 2020 at 21:32)</a>:</h4>
<p>you can see that it invokes <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L132-L141" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L132-L141"><code>program_clauses_that_could_match</code></a>, which has the job of inspecting the goal and the rust-ir</p>



<a name="191539687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539687">(Mar 23 2020 at 21:32)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L153-L158" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L153-L158">this for example is the code that iterates over applicable impls</a></p>



<a name="191539720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539720">(Mar 23 2020 at 21:33)</a>:</h4>
<p>and, in the case of an auto trait like <code>Send</code>, <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L160-L175" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L160-L175">this code</a> generates the "automatic impls"</p>



<a name="191539750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539750">(Mar 23 2020 at 21:33)</a>:</h4>
<p>so we are going to want to add some code into that match arm -- <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L239" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L239">right here, where the FIXME is</a></p>



<a name="191539767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539767">(Mar 23 2020 at 21:33)</a>:</h4>
<p>probably we should make a <code>clauses/builtin_traits.rs</code> module or something</p>



<a name="191539786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539786">(Mar 23 2020 at 21:33)</a>:</h4>
<p>I guess that's already the <em>very first</em> thing we need to do -- add the concept of a "built-in trait"</p>



<a name="191539918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539918">(Mar 23 2020 at 21:34)</a>:</h4>
<p>I think what I would do is to extend <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L89-L102" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-rust-ir/src/lib.rs#L89-L102"><code>TraitDatum</code></a> (or maybe <code>TraitFlags</code>..?) with another field like <code>well_known_trait: Option&lt;WellKnownTrait&gt;</code></p>



<a name="191539965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191539965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191539965">(Mar 23 2020 at 21:35)</a>:</h4>
<p>where we have </p>
<div class="codehilite"><pre><span></span><span class="k">enum</span> <span class="nc">WellKnownTrait</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">SizedTrait</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">CloneTrait</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">CopyTrait</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">...</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>(we can start with just <code>Sized</code>)</p>



<a name="191540023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540023">(Mar 23 2020 at 21:35)</a>:</h4>
<p>we would probably want to extend the parser to permit <code>#[sized] trait Sized { }</code> declarations that have <code>well_known_trait</code> set to <code>Some(SizedTrait)</code></p>



<a name="191540146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540146">(Mar 23 2020 at 21:36)</a>:</h4>
<p>if we want to be lazy, we can add <code>bool</code> fields to <code>TraitFlags</code> for each trait and just follow the model of something like <code>#[marker]</code> (e.g., <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-parse/src/parser.lalrpop#L41" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-parse/src/parser.lalrpop#L41">here is some of the parser code</a>, and here is where the <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-integration/src/lowering.rs#L896-L907" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-integration/src/lowering.rs#L896-L907">parser's flags get convered to builtin chalk flags</a>)</p>



<a name="191540225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540225">(Mar 23 2020 at 21:37)</a>:</h4>
<p>but I guss nah it'd be better to do</p>



<a name="191540396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540396">(Mar 23 2020 at 21:39)</a>:</h4>
<div class="codehilite"><pre><span></span>WellKnownTrait: WellKnownTrait = {
     &quot;#&quot; &quot;[&quot; &quot;lang&quot; &quot;(&quot; &quot;sized&quot; &quot;)&quot; &quot;]&quot; =&gt; WellKnownTrait::Sized,
};
</pre></div>


<p>and then add a <code>&lt;well_known:WellKnownTrait?&gt;</code> into the <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-parse/src/parser.lalrpop#L61" target="_blank" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-parse/src/parser.lalrpop#L61"><code>TraitDefn</code></a> code</p>



<a name="191540454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540454">(Mar 23 2020 at 21:40)</a>:</h4>
<p>here i'm using rustc-style "lang item" annotations, <code>#[lang(sized)]</code> or whatever</p>



<a name="191540954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191540954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191540954">(Mar 23 2020 at 21:45)</a>:</h4>
<p>created <a href="https://github.com/rust-lang/chalk/issues/356" target="_blank" title="https://github.com/rust-lang/chalk/issues/356">https://github.com/rust-lang/chalk/issues/356</a> for this first work item</p>



<a name="191674578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191674578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191674578">(Mar 24 2020 at 21:24)</a>:</h4>
<p>I'm leaving doc comments with my initials for things that I'd like an explanation on</p>



<a name="191674610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191674610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191674610">(Mar 24 2020 at 21:25)</a>:</h4>
<p>with the idea being that you can reply to them in the PR when I open it and I can take those explanation and add them back as doc comments</p>



<a name="191674863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191674863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191674863">(Mar 24 2020 at 21:27)</a>:</h4>
<p>wonderful</p>



<a name="191675421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191675421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191675421">(Mar 24 2020 at 21:32)</a>:</h4>
<p>first steps <a href="https://github.com/rust-lang/chalk/pull/359/files" target="_blank" title="https://github.com/rust-lang/chalk/pull/359/files">https://github.com/rust-lang/chalk/pull/359/files</a></p>



<a name="191675503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191675503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191675503">(Mar 24 2020 at 21:33)</a>:</h4>
<p>moving onto parser code next I think, then im gonna look at where you said the FIXME is with the hope that that is where I set well_known to Some(WellKnownTrait::SizedTrait) or something</p>



<a name="191675906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191675906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191675906">(Mar 24 2020 at 21:37)</a>:</h4>
<p>oh does the lalrpop code construct the TraidDatum?</p>



<a name="191675926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191675926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191675926">(Mar 24 2020 at 21:37)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">name</span>: <span class="nc">n</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">parameter_kinds</span>: <span class="nc">p</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">where_clauses</span>: <span class="nc">w</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">assoc_ty_defns</span>: <span class="nc">a</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">flags</span>: <span class="nc">TraitFlags</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">auto</span>: <span class="nc">auto</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">marker</span>: <span class="nc">marker</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">upstream</span>: <span class="nc">upstream</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">fundamental</span>: <span class="nc">fundamental</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">non_enumerable</span>: <span class="nc">non_enumerable</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">coinductive</span>: <span class="nc">coinductive</span><span class="p">.</span><span class="n">is_some</span><span class="p">(),</span><span class="w"></span>
<span class="w">        </span><span class="p">},</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="191675929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191675929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191675929">(Mar 24 2020 at 21:37)</a>:</h4>
<p>sure looks familiar</p>



<a name="191676056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676056">(Mar 24 2020 at 21:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191675906" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191675906">said</a>:</p>
<blockquote>
<p>oh does the lalrpop code construct the TraidDatum?</p>
</blockquote>
<p>the LALRPOP code constructs the <em>AST</em></p>



<a name="191676071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676071">(Mar 24 2020 at 21:38)</a>:</h4>
<p>which is then converted by lowering into the <code>chalk_rust_ir</code> types</p>



<a name="191676097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676097">(Mar 24 2020 at 21:39)</a>:</h4>
<p>and TraitDatum is a node in the AST?</p>



<a name="191676110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676110">(Mar 24 2020 at 21:39)</a>:</h4>
<p>or whatever the noun is that represents a piece of it</p>



<a name="191676145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676145">(Mar 24 2020 at 21:39)</a>:</h4>
<p>ooh</p>



<a name="191676152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676152">(Mar 24 2020 at 21:39)</a>:</h4>
<p>I'm not sure :)</p>



<a name="191676153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676153">(Mar 24 2020 at 21:39)</a>:</h4>
<p>wait confused</p>



<a name="191676155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676155">(Mar 24 2020 at 21:39)</a>:</h4>
<p>I think not</p>



<a name="191676238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676238">(Mar 24 2020 at 21:40)</a>:</h4>
<p>so <a href="http://rust-lang.github.io/chalk/chalk_parse/ast/index.html" target="_blank" title="http://rust-lang.github.io/chalk/chalk_parse/ast/index.html">these are the AST types</a> that the parser constructs</p>



<a name="191676252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676252">(Mar 24 2020 at 21:40)</a>:</h4>
<p>e.g., <a href="http://rust-lang.github.io/chalk/chalk_parse/ast/struct.TraitDefn.html" target="_blank" title="http://rust-lang.github.io/chalk/chalk_parse/ast/struct.TraitDefn.html"><code>TraitDefn</code></a></p>



<a name="191676282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676282">(Mar 24 2020 at 21:40)</a>:</h4>
<p><a href="http://rust-lang.github.io/chalk/chalk_rust_ir/index.html" target="_blank" title="http://rust-lang.github.io/chalk/chalk_rust_ir/index.html">these are the datum types</a></p>



<a name="191676331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676331">(Mar 24 2020 at 21:41)</a>:</h4>
<p>ooo</p>



<a name="191676601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676601">(Mar 24 2020 at 21:43)</a>:</h4>
<p>so I need to add the well_known field to TraitDefn in ast as well as TraitDatum in chalk_rust_ir</p>



<a name="191676682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676682">(Mar 24 2020 at 21:44)</a>:</h4>
<p>and then presumably I get the well_known field from the Defn and pass it to the Datum in lowering</p>



<a name="191676689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676689">(Mar 24 2020 at 21:44)</a>:</h4>
<p>and maybe "lower" it whatever that means</p>



<a name="191676806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676806">(Mar 24 2020 at 21:45)</a>:</h4>
<p>my current guess/understanding of what lowering means is converting from some richer representation to a simpler one that only has the info you care about, lmk if this is wildly incorrect</p>



<a name="191676857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676857">(Mar 24 2020 at 21:45)</a>:</h4>
<p><em>wishing I took a course on compiler/pl design in college</em></p>



<a name="191676974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676974">(Mar 24 2020 at 21:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191676689" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191676689">said</a>:</p>
<blockquote>
<p>and maybe "lower" it whatever that means</p>
</blockquote>
<p>"lower" means to convert between two representations of the same thing, in some sense,</p>



<a name="191676986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191676986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191676986">(Mar 24 2020 at 21:46)</a>:</h4>
<p>usually convering from one layer of abstraction to another</p>



<a name="191677005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677005">(Mar 24 2020 at 21:47)</a>:</h4>
<p>usually getting farther from the "surface syntax" to something lower level</p>



<a name="191677023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677023">(Mar 24 2020 at 21:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191676806" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191676806">said</a>:</p>
<blockquote>
<p>my current guess/understanding of what lowering means is converting from some richer representation to a simpler one that only has the info you care about, lmk if this is wildly incorrect</p>
</blockquote>
<p>er, yes, roughly this</p>



<a name="191677070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677070">(Mar 24 2020 at 21:47)</a>:</h4>
<p>cool</p>



<a name="191677158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677158">(Mar 24 2020 at 21:48)</a>:</h4>
<p>should this be an Option&lt;WellKnownTrait&gt;?</p>



<a name="191677161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677161">(Mar 24 2020 at 21:48)</a>:</h4>
<p>all the other ones are Vecs</p>



<a name="191677193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677193">(Mar 24 2020 at 21:48)</a>:</h4>
<p>seems like something could be Sized and Clone for example</p>



<a name="191677735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677735">(Mar 24 2020 at 21:52)</a>:</h4>
<p>I think <code>Option</code> would be better</p>



<a name="191677741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677741">(Mar 24 2020 at 21:53)</a>:</h4>
<p>ack</p>



<a name="191677744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677744">(Mar 24 2020 at 21:53)</a>:</h4>
<p>seems strange to have one trait that is "both" the Sized and Clone trait</p>



<a name="191677775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677775">(Mar 24 2020 at 21:53)</a>:</h4>
<p>oh is that the current plan?</p>



<a name="191677786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677786">(Mar 24 2020 at 21:53)</a>:</h4>
<p>to have an SizedCloneTrait, variant?</p>



<a name="191677788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677788">(Mar 24 2020 at 21:53)</a>:</h4>
<p>and so on</p>



<a name="191677790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677790">(Mar 24 2020 at 21:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191677193" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191677193">said</a>:</p>
<blockquote>
<p>seems like something could be Sized and Clone for example</p>
</blockquote>
<p>this is what it would mean</p>



<a name="191677814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677814">(Mar 24 2020 at 21:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191677775" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/191677775">said</a>:</p>
<blockquote>
<p>oh is that the current plan?</p>
</blockquote>
<p>no :)</p>



<a name="191677824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677824">(Mar 24 2020 at 21:53)</a>:</h4>
<p>I'm saying, this attribute we are adding is a way to say to chalk</p>



<a name="191677834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677834">(Mar 24 2020 at 21:53)</a>:</h4>
<p>"this trait is a special trait that you know"</p>



<a name="191677840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677840">(Mar 24 2020 at 21:53)</a>:</h4>
<p>oooooh</p>



<a name="191677867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677867">(Mar 24 2020 at 21:54)</a>:</h4>
<p>i misunderstood</p>



<a name="191677880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677880">(Mar 24 2020 at 21:54)</a>:</h4>
<p>so it's weird for one trait to be multiple of those</p>



<a name="191677890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677890">(Mar 24 2020 at 21:54)</a>:</h4>
<p>i was thinking this was for bounds on other traits</p>



<a name="191677894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677894">(Mar 24 2020 at 21:54)</a>:</h4>
<p>not for THE sized trait</p>



<a name="191677920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677920">(Mar 24 2020 at 21:54)</a>:</h4>
<p>like I thought we were trying to have some way to tie info to <code>trait Foo: Sized + Clone</code></p>



<a name="191677946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677946">(Mar 24 2020 at 21:54)</a>:</h4>
<p>okay, slowly catching up</p>



<a name="191677959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191677959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191677959">(Mar 24 2020 at 21:55)</a>:</h4>
<p>reading lalrpop guide now</p>



<a name="191700031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191700031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191700031">(Mar 25 2020 at 04:15)</a>:</h4>
<p>Okay i think im at the point where im ready for review / further guidance</p>



<a name="191700038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191700038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191700038">(Mar 25 2020 at 04:15)</a>:</h4>
<p>not really clear on what I'm supposed to do wrt Sized in this code <a href="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L239" title="https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L239">https://github.com/rust-lang/chalk/blob/1ac0d00e61b427964c2b9b10e21bd8cd183e5932/chalk-solve/src/clauses.rs#L239</a></p>



<a name="191700039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191700039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191700039">(Mar 25 2020 at 04:15)</a>:</h4>
<p>or if the changes here are meant to be part of this first issue</p>



<a name="191700044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191700044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191700044">(Mar 25 2020 at 04:15)</a>:</h4>
<p>also not sure if I should still be adding the <a href="http://buildin_traits.rs" title="http://buildin_traits.rs">buildin_traits.rs</a> file since we added the well_known field to TraitDatum</p>



<a name="191700801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191700801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191700801">(Mar 25 2020 at 04:34)</a>:</h4>
<p>that TODO there I don't is particularly meaninful</p>



<a name="191807518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191807518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191807518">(Mar 25 2020 at 20:34)</a>:</h4>
<p>for this first version, I would just replace that <code>FIXME</code> with something like</p>
<div class="codehilite"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">well_known</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">trait_defn</span><span class="p">.</span><span class="n">well_known</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">builtin_traits</span>::<span class="n">add_builtin_program_clauses</span><span class="p">(</span><span class="n">well_known</span><span class="p">,</span><span class="w"> </span><span class="n">trait_ref</span><span class="p">,</span><span class="w"> </span><span class="n">builder</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>where</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">add_builtin_program_clauses</span><span class="p">(</span><span class="w"></span>
<span class="w">    </span><span class="n">well_known</span>: <span class="nc">WellKnown</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">...</span><span class="w"></span>
<span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">well_known</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="nb">Sized</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* TODO */</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="191807527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191807527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191807527">(Mar 25 2020 at 20:34)</a>:</h4>
<p>i.e., we're not actually adding any new behavior, just leaving the place where it should be</p>



<a name="191807569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191807569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191807569">(Mar 25 2020 at 20:35)</a>:</h4>
<p>I would still create the module file, but it's only role is to exist so that later diffs are cleaner I guess :)</p>



<a name="191807579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191807579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191807579">(Mar 25 2020 at 20:35)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="191811991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/191811991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#191811991">(Mar 25 2020 at 21:14)</a>:</h4>
<p>okay</p>



<a name="192075610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192075610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192075610">(Mar 27 2020 at 20:29)</a>:</h4>
<p>I was thinking as I wrote up <a href="https://github.com/rust-lang/chalk/issues/363" title="https://github.com/rust-lang/chalk/issues/363">https://github.com/rust-lang/chalk/issues/363</a> ...</p>



<a name="192075617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192075617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192075617">(Mar 27 2020 at 20:29)</a>:</h4>
<p>for traits like the <code>Copy</code> trait</p>



<a name="192075677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192075677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192075677">(Mar 27 2020 at 20:30)</a>:</h4>
<p>I think rustc currently has builtin impls for types like <code>u32</code>..?</p>



<a name="192075687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192075687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192075687">(Mar 27 2020 at 20:30)</a>:</h4>
<p>I guess I'm not sure, we should check</p>



<a name="192076404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076404">(Mar 27 2020 at 20:37)</a>:</h4>
<p>ack</p>



<a name="192076430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076430">(Mar 27 2020 at 20:37)</a>:</h4>
<p>im finishing up the stuff that we've talked about sofar and updating docs based on your review comments</p>



<a name="192076435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076435">(Mar 27 2020 at 20:37)</a>:</h4>
<p>should have a new push in a few minutes</p>



<a name="192076527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076527">(Mar 27 2020 at 20:38)</a>:</h4>
<p>anyway the point is</p>



<a name="192076554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076554">(Mar 27 2020 at 20:38)</a>:</h4>
<p>some of this work will probably be blocked on extending a bit how chalk handles "application types"</p>



<a name="192076566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076566">(Mar 27 2020 at 20:38)</a>:</h4>
<p>right now we just kind of call everything a "struct"</p>



<a name="192076619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076619">(Mar 27 2020 at 20:39)</a>:</h4>
<p>but I think eventually we're going to want to extend the "type name" to include all the variants from rustc (e.g., i32, u32, etc)</p>



<a name="192076625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192076625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192076625">(Mar 27 2020 at 20:39)</a>:</h4>
<p>this shouldn't be hard, just an interaction</p>



<a name="192079614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192079614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192079614">(Mar 27 2020 at 21:01)</a>:</h4>
<p>okay</p>



<a name="192079630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192079630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192079630">(Mar 27 2020 at 21:01)</a>:</h4>
<p>I'm reading the issue now</p>



<a name="192079646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192079646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192079646">(Mar 27 2020 at 21:01)</a>:</h4>
<p>my push is up if you have time and want to review it</p>



<a name="192080379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192080379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192080379">(Mar 27 2020 at 21:07)</a>:</h4>
<p>but my main question now is what do I put <a href="https://github.com/rust-lang/chalk/pull/359/files#diff-90daf0f72783279f47a20ba00551459dR11" title="https://github.com/rust-lang/chalk/pull/359/files#diff-90daf0f72783279f47a20ba00551459dR11">here</a></p>



<a name="192080441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192080441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192080441">(Mar 27 2020 at 21:07)</a>:</h4>
<p>I'm looking at <code>program_clauses_that_could_match</code> to try to figure out what its doing</p>



<a name="192080540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192080540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192080540">(Mar 27 2020 at 21:08)</a>:</h4>
<p>im guessing it will be something like the implementation for <code>push_auto_trait_impls</code></p>



<a name="192081372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081372">(Mar 27 2020 at 21:14)</a>:</h4>
<p>so :)</p>



<a name="192081382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081382">(Mar 27 2020 at 21:15)</a>:</h4>
<p>the unsatisfying answer is "nothing in this PR"</p>



<a name="192081391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081391">(Mar 27 2020 at 21:15)</a>:</h4>
<p>but I guess you're asking for the <em>next</em> one</p>



<a name="192081631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081631">(Mar 27 2020 at 21:17)</a>:</h4>
<p>how much do you get about what this code is doing?</p>



<a name="192081657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081657">(Mar 27 2020 at 21:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192080540" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192080540">said</a>:</p>
<blockquote>
<p>im guessing it will be something like the implementation for <code>push_auto_trait_impls</code></p>
</blockquote>
<p>something like that, and this would be a tolerable "starting point", though it isn't really doing the right rule overall</p>



<a name="192081670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192081670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192081670">(Mar 27 2020 at 21:17)</a>:</h4>
<p>I guess I should leave some notes in <a href="https://github.com/rust-lang/chalk/issues/261" title="https://github.com/rust-lang/chalk/issues/261">https://github.com/rust-lang/chalk/issues/261</a></p>



<a name="192082454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192082454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192082454">(Mar 27 2020 at 21:25)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/issues/261#issuecomment-605321853" title="https://github.com/rust-lang/chalk/issues/261#issuecomment-605321853">left some high-level notes here</a></p>



<a name="192082531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192082531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192082531">(Mar 27 2020 at 21:26)</a>:</h4>
<p>i am getting more of an understanding of what this is doing, but for example, I dont know exactly when and how often program_clauses_that_could_match would be called, or what it would be trying to prove. I see that the part that we're focusing on is inside of the arm <code>DomainGoal::Holds(WhereClause::Implemented(trait_ref)) =&gt; {</code>, which I'm guessing means that we're trying to assert that some trait is implemented, probably because we're passing in some type to some function with a trait bound and we want to verify that the type implement's the trait, but it seems odd to me that we'd generate impls for <code>Sized</code> / other well known traits every time</p>



<a name="192082568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192082568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192082568">(Mar 27 2020 at 21:26)</a>:</h4>
<p>so I guess I think I dont quite understand what we're adding to the program clauses or how they represent the builtin traits</p>



<a name="192082581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192082581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192082581">(Mar 27 2020 at 21:27)</a>:</h4>
<p>but like I said im reading this stuff all rn</p>



<a name="192082595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192082595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192082595">(Mar 27 2020 at 21:27)</a>:</h4>
<p>reading high lvel notes now</p>



<a name="192423153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192423153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192423153">(Mar 31 2020 at 17:34)</a>:</h4>
<p>looking to do more work on <a href="https://github.com/rust-lang/chalk/issues/261" title="https://github.com/rust-lang/chalk/issues/261">https://github.com/rust-lang/chalk/issues/261</a> today</p>



<a name="192423476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192423476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192423476">(Mar 31 2020 at 17:37)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> here's something I've done locally to move work on rustc integration forward: <a href="https://github.com/jackh726/chalk/commit/6e206ec2f27d561016ece3f66b1c7d41d74ba7bb" title="https://github.com/jackh726/chalk/commit/6e206ec2f27d561016ece3f66b1c7d41d74ba7bb">https://github.com/jackh726/chalk/commit/6e206ec2f27d561016ece3f66b1c7d41d74ba7bb</a></p>



<a name="192423496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192423496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192423496">(Mar 31 2020 at 17:37)</a>:</h4>
<p>It works quite well</p>



<a name="192423617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192423617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192423617">(Mar 31 2020 at 17:38)</a>:</h4>
<p>I didn't get a reply from <span class="user-mention" data-user-id="116009">@nikomatsakis</span> about whether or not this is something we might want to do in the interim until we have correct rules</p>



<a name="192424089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424089">(Mar 31 2020 at 17:42)</a>:</h4>
<p>okay</p>



<a name="192424118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424118">(Mar 31 2020 at 17:42)</a>:</h4>
<p>noob question but</p>



<a name="192424124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424124">(Mar 31 2020 at 17:42)</a>:</h4>
<p>can you explain this to me?</p>



<a name="192424129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424129">(Mar 31 2020 at 17:42)</a>:</h4>
<p><code>builder.push_fact(trait_ref.clone());</code></p>



<a name="192424147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424147">(Mar 31 2020 at 17:42)</a>:</h4>
<p>/me I feel like i should read the chalk dev guide</p>



<a name="192424179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424179">(Mar 31 2020 at 17:42)</a>:</h4>
<p>so the trait_ref is a fact?</p>



<a name="192424245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424245">(Mar 31 2020 at 17:43)</a>:</h4>
<p>This is just adding the clause <code>Struct: Trait&lt;...&gt;</code></p>



<a name="192424299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424299">(Mar 31 2020 at 17:43)</a>:</h4>
<p>it's a maybe a bit confusing</p>



<a name="192424308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424308">(Mar 31 2020 at 17:43)</a>:</h4>
<p>because of the <code>CastTo</code>s</p>



<a name="192424385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424385">(Mar 31 2020 at 17:44)</a>:</h4>
<p>Yeah, the trait_ref thing confused me too before</p>



<a name="192424458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424458">(Mar 31 2020 at 17:44)</a>:</h4>
<p>because <code>TraitRef</code> casts to <code>WhereClause</code> which casts to <code>DomainGoal::Holds(WhereClause)</code></p>



<a name="192424506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424506">(Mar 31 2020 at 17:45)</a>:</h4>
<p>more generally though</p>



<a name="192424557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424557">(Mar 31 2020 at 17:45)</a>:</h4>
<p>a <code>TraitRef</code> contains a <code>Trait</code> and a <code>Substituion</code></p>



<a name="192424653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424653">(Mar 31 2020 at 17:46)</a>:</h4>
<p>I think in <em>most</em> (can't say for all for sure), the <strong>first</strong> parameter is the <code>Self</code> type</p>



<a name="192424751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424751">(Mar 31 2020 at 17:46)</a>:</h4>
<p>So, e.g., say we had <code>Foo: Bar&lt;Baz&gt;</code></p>



<a name="192424786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424786">(Mar 31 2020 at 17:47)</a>:</h4>
<p>whats a substitution?</p>



<a name="192424810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424810">(Mar 31 2020 at 17:47)</a>:</h4>
<p>```/// A mapping of inference variables to instantiations thereof.</p>
<div class="codehilite"><pre><span></span>
</pre></div>



<a name="192424813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424813">(Mar 31 2020 at 17:47)</a>:</h4>
<p>blasdlfaksh</p>



<a name="192424825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424825">(Mar 31 2020 at 17:47)</a>:</h4>
<p>regardless of formatting &gt;:[</p>



<a name="192424832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424832">(Mar 31 2020 at 17:47)</a>:</h4>
<p>this doesn't explain much to me</p>



<a name="192424846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424846">(Mar 31 2020 at 17:47)</a>:</h4>
<p>the <code>TraitRef</code> would look like <code>{ trait_id: Bar, substitution: [Foo, Baz] }</code></p>



<a name="192424894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192424894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192424894">(Mar 31 2020 at 17:48)</a>:</h4>
<p>are Foo / Baz types that impl Bar?</p>



<a name="192425029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192425029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192425029">(Mar 31 2020 at 17:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192424751" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192424751">said</a>:</p>
<blockquote>
<p>So, e.g., say we had <code>Foo: Bar&lt;Baz&gt;</code></p>
</blockquote>
<p>Foo is a struct, Baz is a different struct, used as a generic for Bar</p>



<a name="192425109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192425109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192425109">(Mar 31 2020 at 17:49)</a>:</h4>
<p>(so you would have <code>struct Foo; struct Baz; trait Bar&lt;T&gt; {}</code></p>



<a name="192425167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192425167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192425167">(Mar 31 2020 at 17:49)</a>:</h4>
<p>a substitution is essentially just a list of types and lifetimes</p>



<a name="192426517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426517">(Mar 31 2020 at 17:59)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> IMO substitutions should be printed not like an array but something more uhhh</p>



<a name="192426544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426544">(Mar 31 2020 at 17:59)</a>:</h4>
<p><code>[#0 -&gt; Foo, #1 -&gt; Baz]</code></p>



<a name="192426614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426614">(Mar 31 2020 at 18:00)</a>:</h4>
<p>they're replacements for parameters</p>



<a name="192426676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426676">(Mar 31 2020 at 18:00)</a>:</h4>
<p>yeah, this is how they're normally printed</p>



<a name="192426679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426679">(Mar 31 2020 at 18:00)</a>:</h4>
<p><code>[Self -&gt; Foo, T -&gt; Baz]</code> would be even clearer but that requires extra information</p>



<a name="192426721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426721">(Mar 31 2020 at 18:00)</a>:</h4>
<p>or you can just print <code>Foo: Bar&lt;Baz&gt;</code></p>



<a name="192426769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426769">(Mar 31 2020 at 18:01)</a>:</h4>
<p>also substitution saying "inference"... different "substitution"?</p>



<a name="192426789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426789">(Mar 31 2020 at 18:01)</a>:</h4>
<p>idk if Chalk calls "generic args" something other than "substitution"</p>



<a name="192426815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426815">(Mar 31 2020 at 18:01)</a>:</h4>
<p>that doc comment is wrong I think</p>



<a name="192426924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192426924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192426924">(Mar 31 2020 at 18:02)</a>:</h4>
<p>because we use <code>Substitution</code> for more then were there are inferences variables</p>



<a name="192427206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427206">(Mar 31 2020 at 18:04)</a>:</h4>
<p>so the substitutions are the mappings of generic params (inference variables) to concrete types (instantiations thereof)</p>



<a name="192427264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427264">(Mar 31 2020 at 18:05)</a>:</h4>
<p>yeah</p>



<a name="192427403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427403">(Mar 31 2020 at 18:06)</a>:</h4>
<p>so a <code>TraitRef</code> is a partially (completely?) resolved trait bound?</p>



<a name="192427464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427464">(Mar 31 2020 at 18:06)</a>:</h4>
<p>Um, no not resolved</p>



<a name="192427505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427505">(Mar 31 2020 at 18:06)</a>:</h4>
<p>So, it would be <code>?0: Bar&lt;Baz&gt;</code></p>



<a name="192427610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427610">(Mar 31 2020 at 18:07)</a>:</h4>
<p>I know <code>!</code> means placeholder</p>



<a name="192427661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427661">(Mar 31 2020 at 18:08)</a>:</h4>
<p>what does <code>?</code> mean in chalk logic lang syntax?</p>



<a name="192427779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427779">(Mar 31 2020 at 18:09)</a>:</h4>
<p>inference variable</p>



<a name="192427831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192427831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192427831">(Mar 31 2020 at 18:09)</a>:</h4>
<p><code>!0_0</code> is placeholder<br>
<code>?0</code> is inference variable<br>
<code>^0_0</code> is bound variable</p>



<a name="192428066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428066">(Mar 31 2020 at 18:11)</a>:</h4>
<p>okay</p>



<a name="192428076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428076">(Mar 31 2020 at 18:11)</a>:</h4>
<p>is all of this covered in the chalk book?</p>



<a name="192428192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428192">(Mar 31 2020 at 18:12)</a>:</h4>
<p>I think today I shall read the chalk book</p>



<a name="192428273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428273">(Mar 31 2020 at 18:12)</a>:</h4>
<p>uh, I think</p>



<a name="192428320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428320">(Mar 31 2020 at 18:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192424810" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192424810">said</a>:</p>
<blockquote>
<p>A mapping of inference variables to instantiations thereof.</p>
</blockquote>
<p>hmm that's a pretty bad comment.</p>



<a name="192428517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428517">(Mar 31 2020 at 18:14)</a>:</h4>
<p>:/</p>



<a name="192428524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428524">(Mar 31 2020 at 18:14)</a>:</h4>
<p>and theres nothing on <code>TraitRef</code></p>



<a name="192428585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428585">(Mar 31 2020 at 18:14)</a>:</h4>
<p>I think a better one might something like:</p>
<ul>
<li>A set of values for the generic type arguments declared on something. For example, given a struct like <code>struct Foo&lt;T, U&gt; { }</code> and some reference to that type <code>Foo&lt;u32, i32&gt;</code>, the <em>substitution</em> for <code>T</code> would be <code>[u32, i32]</code>.</li>
</ul>



<a name="192428663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428663">(Mar 31 2020 at 18:15)</a>:</h4>
<ul>
<li>A "trait ref" is a reference to a trait plus its associated substitution -- so something like <code>u32: Iterator</code> or maybe <code>u32: PartialEq&lt;u32&gt;</code></li>
</ul>



<a name="192428667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428667">(Mar 31 2020 at 18:15)</a>:</h4>
<p>err, <code>[T, U]</code> right?</p>



<a name="192428677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428677">(Mar 31 2020 at 18:15)</a>:</h4>
<p>no</p>



<a name="192428704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428704">(Mar 31 2020 at 18:15)</a>:</h4>
<p>a substitution is the <em>values provided for the generic parameters</em></p>



<a name="192428711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428711">(Mar 31 2020 at 18:15)</a>:</h4>
<p>so, u32, i32</p>



<a name="192428720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428720">(Mar 31 2020 at 18:15)</a>:</h4>
<p>T, U are the generic parameters</p>



<a name="192428768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428768">(Mar 31 2020 at 18:16)</a>:</h4>
<p>right, but the substitution is <code>T =&gt; u32, U =&gt; i32</code></p>



<a name="192428788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428788">(Mar 31 2020 at 18:16)</a>:</h4>
<p>well, the T, U are "implicit" in the ordering</p>



<a name="192428800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428800">(Mar 31 2020 at 18:16)</a>:</h4>
<p>but yes sometimes people write the notation <code>[T =&gt; u32, U =&gt; i32]</code></p>



<a name="192428821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428821">(Mar 31 2020 at 18:16)</a>:</h4>
<p>I avoided it because we don't store names in chalk, and just use the position</p>



<a name="192428824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428824">(Mar 31 2020 at 18:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192428585" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192428585">said</a>:</p>
<blockquote>
<p>I think a better one might something like:</p>
<ul>
<li>A set of values for the generic type arguments declared on something. For example, given a struct like <code>struct Foo&lt;T, U&gt; { }</code> and some reference to that type <code>Foo&lt;u32, i32&gt;</code>, <strong>the <em>substitution</em> for <code>T</code> would be <code>[u32, i32]</code></strong>.</li>
</ul>
</blockquote>
<p>this bit here</p>



<a name="192428837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428837">(Mar 31 2020 at 18:16)</a>:</h4>
<p>ah sorry ;)</p>



<a name="192428844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428844">(Mar 31 2020 at 18:16)</a>:</h4>
<p>editing fail!</p>



<a name="192428881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428881">(Mar 31 2020 at 18:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192428585" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192428585">said</a>:</p>
<blockquote>
<ul>
<li>A set of values for the generic type arguments declared on something. For example, given a struct like <code>struct Foo&lt;T, U&gt; { }</code> and some reference to that type <code>Foo&lt;u32, i32&gt;</code>, the <em>substitution</em> for <code>Foo&lt;u32, i32&gt;</code> would be <code>[u32, i32]</code>.</li>
</ul>
</blockquote>



<a name="192428907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428907">(Mar 31 2020 at 18:17)</a>:</h4>
<p>there we go</p>



<a name="192428939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192428939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192428939">(Mar 31 2020 at 18:17)</a>:</h4>
<p>thanks <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="192429046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429046">(Mar 31 2020 at 18:18)</a>:</h4>
<p>I'd write out the <code>[T =&gt; u32, U =&gt; i32]</code> then mention that it's <em>represented</em> as just <code>[u32, i32]</code></p>



<a name="192429052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429052">(Mar 31 2020 at 18:18)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> do those definitions help?</p>



<a name="192429081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429081">(Mar 31 2020 at 18:18)</a>:</h4>
<p>the think about "trait references" is that they don't have "semantics" themselves, they appear in a lot of things</p>



<a name="192429103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429103">(Mar 31 2020 at 18:18)</a>:</h4>
<p>e.g., <code>where Foo: PartialEq&lt;u32&gt;</code>, is a where-clause that contains a trait-ref</p>



<a name="192429111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429111">(Mar 31 2020 at 18:18)</a>:</h4>
<p>yea, at least the first ones, i haven't read the last few messages between you and jack yet since your bullets above</p>



<a name="192429137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429137">(Mar 31 2020 at 18:19)</a>:</h4>
<p>was busy copying what you said into the doccomment for Substitution and TraitRef</p>



<a name="192429149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429149">(Mar 31 2020 at 18:19)</a>:</h4>
<p>and we have goals like <code>Implemented(Foo: PartialEq&lt;u32&gt;)</code>, where you are trying to prove that a trait-ref is implemented</p>



<a name="192429160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429160">(Mar 31 2020 at 18:19)</a>:</h4>
<p>and abstracting your example into an actual rust code snippet</p>



<a name="192429176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429176">(Mar 31 2020 at 18:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192429046" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192429046">said</a>:</p>
<blockquote>
<p>I'd write out the <code>[T =&gt; u32, U =&gt; i32]</code> then mention that it's <em>represented</em> as just <code>[u32, i32]</code></p>
</blockquote>
<p>this is probably the right thing for the doc-comment</p>



<a name="192429198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429198">(Mar 31 2020 at 18:19)</a>:</h4>
<p>especially for traits, it'd be good to have the <code>[Self =&gt; ..., T =&gt; ...]</code> explicit, even if only in a doc comment</p>



<a name="192429308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429308">(Mar 31 2020 at 18:20)</a>:</h4>
<p>yeah, that's the other thing, that we often use the notation <code>P0: Trait&lt;P1..Pn&gt;</code> for trait references, to look more  like Rust</p>



<a name="192429332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429332">(Mar 31 2020 at 18:20)</a>:</h4>
<p>but internally it's kind of more like <code>Trait&lt;P0..Pn&gt;</code></p>



<a name="192429338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429338">(Mar 31 2020 at 18:20)</a>:</h4>
<p>where the <code>Self</code> type is "parameter 0"</p>



<a name="192429376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429376">(Mar 31 2020 at 18:20)</a>:</h4>
<p>there are some places in the AST where we have just <code>Trait&lt;P1..Pn&gt;</code> (without a self type) -- I call those <em>bounds</em></p>



<a name="192429391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429391">(Mar 31 2020 at 18:20)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="sd">/// A set of values for the generic type arguments declared on something.</span>
<span class="sd">///</span>
<span class="sd">/// # Example</span>
<span class="sd">///</span>
<span class="sd">/// ```rust</span>
<span class="sd">/// // Given a struct</span>
<span class="sd">/// struct Foo&lt;T, U&gt; { }</span>
<span class="sd">///</span>
<span class="sd">/// // And a reference to that like</span>
<span class="sd">/// type Bar = Foo&lt;u32, i32&gt;;</span>
<span class="sd">///</span>
<span class="sd">/// // The substitution for T would be `[u32, i32]`</span>
<span class="sd">/// ```</span>
</pre></div>



<a name="192429424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429424">(Mar 31 2020 at 18:21)</a>:</h4>
<blockquote>
<p>but internally it's kind of more like <code>Trait&lt;P0..Pn&gt;</code></p>
</blockquote>
<p>in other words, there's just a substitution with a "flat list" of parameters, the self type is not special in any way apart from notation</p>



<a name="192429428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429428">(Mar 31 2020 at 18:21)</a>:</h4>
<p>is this accurate?</p>



<a name="192429441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429441">(Mar 31 2020 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> note the editing fail (that <span class="user-mention" data-user-id="116009">@nikomatsakis</span> later resolved)</p>



<a name="192429476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429476">(Mar 31 2020 at 18:21)</a>:</h4>
<p>almost -- change "substitution for T" to "substitution for Bar" perhaps</p>



<a name="192429492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429492">(Mar 31 2020 at 18:21)</a>:</h4>
<p>which is what <span class="user-mention" data-user-id="119009">@eddyb</span> is referring to</p>



<a name="192429508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429508">(Mar 31 2020 at 18:21)</a>:</h4>
<p>ack</p>



<a name="192429667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429667">(Mar 31 2020 at 18:22)</a>:</h4>
<blockquote>
<p>u32: Iterator or maybe u32: PartialEq&lt;u32&gt;</p>
</blockquote>



<a name="192429677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429677">(Mar 31 2020 at 18:22)</a>:</h4>
<p>I dont understand this</p>



<a name="192429678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429678">(Mar 31 2020 at 18:23)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="sd">/// A set of values for the generic type arguments declared on something.</span>
<span class="sd">///</span>
<span class="sd">/// # Example</span>
<span class="sd">///</span>
<span class="sd">/// Given a struct</span>
<span class="sd">///</span>
<span class="sd">/// ```rust</span>
<span class="sd">/// struct Foo&lt;T, U&gt; { }</span>
<span class="sd">/// ```</span>
<span class="sd">///</span>
<span class="sd">/// then the substitution for a type like `Foo&lt;u32, i32&gt;` would be `[T =&gt; u32, U =&gt; i32]`.</span>
<span class="sd">/// However, in chalk we don&#39;t store the names T, U and instead just represent</span>
<span class="sd">/// everything positionally, so we would simply store `[u32, i32]`.</span>
</pre></div>



<a name="192429688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429688">(Mar 31 2020 at 18:23)</a>:</h4>
<p>is this saying a u32 that represents an iterator?</p>



<a name="192429690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429690">(Mar 31 2020 at 18:23)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> maybe that <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="192429707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429707">(Mar 31 2020 at 18:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192429688" title="#narrow/stream/144729-wg-traits/topic/builtin.20traits/near/192429688">said</a>:</p>
<blockquote>
<p>is this saying a u32 that represents an iterator?</p>
</blockquote>
<p>no</p>



<a name="192429733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429733">(Mar 31 2020 at 18:23)</a>:</h4>
<p>u32 is just "some type" in that example</p>



<a name="192429758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429758">(Mar 31 2020 at 18:23)</a>:</h4>
<p>the point is, a trait-ref is:</p>
<ul>
<li>the name of a trait plus a substitution providing values for all of its generic arguments</li>
</ul>



<a name="192429810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429810">(Mar 31 2020 at 18:24)</a>:</h4>
<p>maybe use a different trait :P</p>



<a name="192429829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429829">(Mar 31 2020 at 18:24)</a>:</h4>
<p>we use the notation <code>P0: Trait&lt;P1..Pn&gt;</code></p>



<a name="192429831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429831">(Mar 31 2020 at 18:24)</a>:</h4>
<p><code>u32: TryInto&lt;i32&gt;</code></p>



<a name="192429871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429871">(Mar 31 2020 at 18:24)</a>:</h4>
<p>which takes the first (Self) parameter, <code>P0</code>, and writes it in a different spot</p>



<a name="192429881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429881">(Mar 31 2020 at 18:24)</a>:</h4>
<p>but that's just a convention based on Rust surface syntax</p>



<a name="192429943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192429943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192429943">(Mar 31 2020 at 18:25)</a>:</h4>
<p>side note that I like calling it <code>P0</code> because of the <em>positional</em> nature of a substitution: i.e., it is the 0th parameter in the substitution</p>



<a name="192430005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430005">(Mar 31 2020 at 18:25)</a>:</h4>
<p>so for <code>u32: TryInto&lt;i32&gt;</code> the TraitRef would be</p>



<a name="192430013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430013">(Mar 31 2020 at 18:25)</a>:</h4>
<p>this is all making me think, <span class="user-mention" data-user-id="232957">@Jack Huey</span>, that we should add some "chalk book" goals to our sprint</p>



<a name="192430016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430016">(Mar 31 2020 at 18:25)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="n">TraitRef</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</pre></div>



<a name="192430026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430026">(Mar 31 2020 at 18:25)</a>:</h4>
<p>I feel like there's still a lack of "overview"</p>



<a name="192430028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430028">(Mar 31 2020 at 18:25)</a>:</h4>
<p>mfkingererlkjkj</p>



<a name="192430164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430164">(Mar 31 2020 at 18:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yeah, that would be good</p>



<a name="192430194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430194">(Mar 31 2020 at 18:27)</a>:</h4>
<p>I took at look at that <code>GLOSSARY.md</code></p>



<a name="192430214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430214">(Mar 31 2020 at 18:27)</a>:</h4>
<p>I'm not sure 90% of that is useful</p>



<a name="192430221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430221">(Mar 31 2020 at 18:27)</a>:</h4>
<p>but there is a chunk that is</p>



<a name="192430341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430341">(Mar 31 2020 at 18:28)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="sd">/// A &quot;trait ref&quot; is the name of a trait (trait_id) plus a substitution</span>
<span class="sd">/// providing values for all of its generic arguments</span>
<span class="sd">///</span>
<span class="sd">/// # Example</span>
<span class="sd">///</span>
<span class="sd">/// So for an ??? like `u32: TryInto&lt;i32&gt;` the TraitRef would look like:</span>
<span class="sd">///</span>
<span class="sd">/// ```rust</span>
<span class="sd">/// TraitRef {</span>
<span class="sd">///     trait_id: &lt;id_of_TryInto&gt;,</span>
<span class="sd">///     substitution: Substitution {</span>
<span class="sd">///         parameters: [Self =&gt; u32, T =&gt; i32],</span>
<span class="sd">///     }</span>
<span class="sd">/// }</span>
<span class="sd">/// ```</span>
</pre></div>



<a name="192430446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430446">(Mar 31 2020 at 18:29)</a>:</h4>
<p>Yes, that is correct.</p>



<a name="192430463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430463">(Mar 31 2020 at 18:29)</a>:</h4>
<p>I would just say "for a trait reference like <code>u32: TryInto&lt;i32&gt;</code>"</p>



<a name="192430494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430494">(Mar 31 2020 at 18:29)</a>:</h4>
<p>the idea of the name "trait reference" is that it's a <em>reference to a trait</em></p>



<a name="192430520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430520">(Mar 31 2020 at 18:29)</a>:</h4>
<p>i.e., we're referring to a trait, and when we do so, we have to also give values for its generic arguments</p>



<a name="192430525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430525">(Mar 31 2020 at 18:29)</a>:</h4>
<p>but maybe we can find a better name? :)</p>



<a name="192430621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430621">(Mar 31 2020 at 18:30)</a>:</h4>
<p>maybe even <code>TraitSubstitution</code> or something...?</p>



<a name="192430760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430760">(Mar 31 2020 at 18:31)</a>:</h4>
<p>where are trait references used</p>



<a name="192430778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430778">(Mar 31 2020 at 18:31)</a>:</h4>
<p>they're used when type checking if inputs to functions and structs are valid right?</p>



<a name="192430829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430829">(Mar 31 2020 at 18:31)</a>:</h4>
<p>yea i feel like "TraitRef" is a bit abstract</p>



<a name="192430838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430838">(Mar 31 2020 at 18:31)</a>:</h4>
<p>but i guess its also just an abstract thing</p>



<a name="192430848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430848">(Mar 31 2020 at 18:31)</a>:</h4>
<p>but that does make it harder to understand</p>



<a name="192430960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430960">(Mar 31 2020 at 18:32)</a>:</h4>
<p><code>TraitUse</code> might be slightly better, hmm. or just <code>Trait</code>, if you dare :P</p>



<a name="192430966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430966">(Mar 31 2020 at 18:32)</a>:</h4>
<p>TraitSubstitution makes sense</p>



<a name="192430980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430980">(Mar 31 2020 at 18:32)</a>:</h4>
<p>TraitUse sounds okay too</p>



<a name="192430993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192430993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192430993">(Mar 31 2020 at 18:32)</a>:</h4>
<p>presumably they're used in bounds</p>



<a name="192431003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431003">(Mar 31 2020 at 18:32)</a>:</h4>
<p>TraitBound?</p>



<a name="192431013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431013">(Mar 31 2020 at 18:33)</a>:</h4>
<p>but its not just a bound right</p>



<a name="192431029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431029">(Mar 31 2020 at 18:33)</a>:</h4>
<p>its a bound + the inputs that might or might not satisfy it, right?</p>



<a name="192431075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431075">(Mar 31 2020 at 18:33)</a>:</h4>
<p>no, it's just the bound part</p>



<a name="192431206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431206">(Mar 31 2020 at 18:34)</a>:</h4>
<p>like if you write <code>T: Into&lt;String&gt;</code> in Rust, that's <code>TraitBound(TraitRef { trait: Into, substs: [T, String] })</code></p>



<a name="192431382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431382">(Mar 31 2020 at 18:35)</a>:</h4>
<p>and if this is on a function and you want to check users of that function, you end up substituting the <code>T</code> there with whatever type from the callsite, and that's the only way a trait bound is... idk, "changed"?</p>



<a name="192431467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431467">(Mar 31 2020 at 18:36)</a>:</h4>
<p>I see</p>



<a name="192431479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431479">(Mar 31 2020 at 18:36)</a>:</h4>
<p>tbh "generic args" might be more straight-forward terminology than "substitutions"</p>



<a name="192431530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431530">(Mar 31 2020 at 18:36)</a>:</h4>
<p>it's only the operation of applying them that might still need to be call "substitute"</p>



<a name="192431579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431579">(Mar 31 2020 at 18:37)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="sd">/// A &quot;trait ref&quot; is the name of a trait (trait_id) plus a substitution</span>
<span class="sd">/// providing values for all of its generic arguments</span>
<span class="sd">///</span>
<span class="sd">/// # Example</span>
<span class="sd">///</span>
<span class="sd">/// So for an trait substitution like `U: TryInto&lt;i32&gt;` the TraitRef would look</span>
<span class="sd">/// like:</span>
<span class="sd">///</span>
<span class="sd">/// ```rust</span>
<span class="sd">/// TraitRef {</span>
<span class="sd">///     trait_id: &lt;id_of_TryInto&gt;,</span>
<span class="sd">///     substitution: Substitution {</span>
<span class="sd">///         parameters: [Self =&gt; U, T =&gt; i32],</span>
<span class="sd">///     }</span>
<span class="sd">/// }</span>
<span class="sd">/// ```</span>
</pre></div>



<a name="192431617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431617">(Mar 31 2020 at 18:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> also you <em>really</em> want to solve the problem of generic "domains" or w/e, terminology/documentation-wise :P</p>



<a name="192431623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431623">(Mar 31 2020 at 18:37)</a>:</h4>
<p>GenericSubstitutions</p>



<a name="192431702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431702">(Mar 31 2020 at 18:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> we struggled to come up with our own to describe what miri does</p>



<a name="192431788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431788">(Mar 31 2020 at 18:38)</a>:</h4>
<p>because miri has a stack of functions but it monomorphizes stuff from each function's body to one "domain", which matches the <code>ParamEnv</code> of the whole miri execution</p>



<a name="192431857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192431857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192431857">(Mar 31 2020 at 18:39)</a>:</h4>
<p>and it took a while before we got everything right, and now a bunch of methods have comments on them trying to describe the relationships, but since there's no official terminology...</p>



<a name="192435942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192435942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192435942">(Mar 31 2020 at 19:12)</a>:</h4>
<p>I am interested in bikeshedding a lot of this stuff -- I was wanting to go and compare the names rustc / chalk are using and make up a list</p>



<a name="192435973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192435973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192435973">(Mar 31 2020 at 19:13)</a>:</h4>
<p>my intuition is that the right set of names can make a big difference for people new to the code</p>



<a name="192436006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192436006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192436006">(Mar 31 2020 at 19:13)</a>:</h4>
<p>my intution is <em>also</em> that  names based on PL jargon are often pretty confusing (perhaps "substitution" is an example)</p>



<a name="192436046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192436046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192436046">(Mar 31 2020 at 19:13)</a>:</h4>
<p>I know rustc is using the term <code>GenericArg</code>, for example, whereas chalk uses <code>Parameter</code> --</p>



<a name="192436115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192436115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192436115">(Mar 31 2020 at 19:14)</a>:</h4>
<p>I remember the discussion and I think that indeed <code>GenericArg</code> feels "more correct" to me, since I tend to think of "arguments" as "the values provided for parameters"</p>



<a name="192436157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192436157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192436157">(Mar 31 2020 at 19:14)</a>:</h4>
<p>also I like the term "domain", <span class="user-mention" data-user-id="119009">@eddyb</span>, if I understand what you're using it for</p>



<a name="192436186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192436186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192436186">(Mar 31 2020 at 19:14)</a>:</h4>
<p>I usually think of it as a "generic context" or something but domain is maybe nice</p>



<a name="192437600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192437600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192437600">(Mar 31 2020 at 19:25)</a>:</h4>
<p>happy to be the confused guide to what names could use improvement</p>



<a name="192437606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192437606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192437606">(Mar 31 2020 at 19:25)</a>:</h4>
<p>lol</p>



<a name="192438276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192438276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192438276">(Mar 31 2020 at 19:30)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> well, if it helps, <span class="user-mention" data-user-id="124288">@oli</span> got the <code>Substs</code>/<code>ParamEnv</code> treatment in miri wrong until we sat down and unpacked the desired semantics :P</p>



<a name="192438356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/builtin%20traits/near/192438356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/builtin.20traits.html#192438356">(Mar 31 2020 at 19:31)</a>:</h4>
<p>reasoning about how types fit and when/where they make sense can get pretty bad rn, that's why I want a better terminology etc.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>